/**
 * @Author: 刘加明
 **/
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 维护备件采购发票认证主数据
export const getPartInvoice = params => axios.get(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice`, { params });

// 维护备件采购发票认证新建搜索
export const getInvoiceItem = params => axios.get(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/invoiceItem`, { params });

// 供应商下拉
export const getProvider = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/businessCustomer`, { params });

// 发票类型下拉
export const getInvoiceType = params => axios.get(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/invoiceType`, { params });

// 明细
export const getInvoiceItemX = (authId, params) => axios.get(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/invoiceItem/${authId}`, { params });

// 查询所有员工
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

// 查询编辑表单
export const getInvoice = (id, params) => axios.get(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/invoice/${id}`, { params });

// 查询结算表格
export const getInvoiceSett = (id, params) => axios.get(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/invoiceSett/${id}`, { params });

// 新增-编辑保存
export const postPartInvoice = params => axios.post(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice`, params);

// 删除明细
export const deleteInvoiceItem = (id, params) => axios.delete(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/deleteInvoice/${id}`, { params });

// 发票认证-取消
export const inputInvoice = (id, status) => axios.put(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/inputInvoice/${id}/${status}`);

// 删除主界面信息
export const deleteInvoices = (id, params) => axios.delete(`${SERVER.DMSCLOUD_PART}/partInfo/PartInvoice/deleteInvoices/${id}`, { params });
